(function($){
	$.fn.changeImgZoom=function(options){
		var defaults = {"numThumb": 5};
		var settings = $.extend(defaults, options ||{});
		var navTopArrow=$("<div/>", {
			"class":"znav-top-arrow"
		});
		var zNavInner = $(".z-nav-inner");
		var navBottomArrow=$("<div/>", {
			"class":"znav-bottom-arrow"
		});

		$(this).prepend(navTopArrow);
		$(this).append(navBottomArrow);
		$(this).find("a").on("mouseover", function(){
			$("#imgZoomMain").attr("src",$(this).find("img").attr("src"));
			$("#imgZoomMain").elevateZoom({tint:true, scrollZoom : true});
		});
		var navItemHeight=parseFloat(zNavInner.find("li").height());
		var navHeight=0;
		$(navBottomArrow).on("click", function(){
			if(navHeight<=zNavInner.find("li").length * zNavInner.find("li").height())
			{
				navHeight +=zNavInner.height()-(zNavInner.outerHeight()-zNavInner.innerHeight());
			}
			else{
				navHeight = 0;
			}
			zNavInner.find("ul").animate({"margin-top":navHeight*-1});
		});
		//navHeight=0;
		$(navTopArrow).on("click", function(){
			if(navHeight>zNavInner.find("li").length * zNavInner.find("li").height())
			{
				navHeight -=zNavInner.height()-(zNavInner.outerHeight()-zNavInner.innerHeight());
			}
			else{
				navHeight=0;
			}
			zNavInner.find("ul").animate({"margin-top": navHeight*-1});			
		});
	}
	
}(jQuery));
(function($){
	$(document).ready(function(e) {
	   	$("#imgZoomMain").elevateZoom({tint:true, scrollZoom : true});
    	$(".zoom-nav").changeImgZoom();
		$(".tab-head").find("a").kyersTab();
	});
}(jQuery));